/*
package com.websocket.websocket.config;

import com.alibaba.fastjson.JSONObject;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;

import java.util.HashMap;

*/
/**
 * @author ypz
 * @date 2021/9/6 10:09
 *//*

//相当于controller处理器
public class WebSocketHandler0 extends TextWebSocketHandler {
    @Override
    protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
        String payload = message.getPayload();
        HashMap hashMap = JSONObject.parseObject(payload, HashMap.class);
        System.out.println("接收到的数据"+hashMap);
        session.sendMessage(new TextMessage("服务器返回的消息,"+payload));
    }

    @Override
    public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
        super.handleMessage(session, message);
    }
}
*/
